package com.hnas.ecard.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.hnas.ecard.dao.CommoditOrderDetailDao;
import com.hnas.ecard.orm.CommoditOrderDetail;
import com.hnas.ecard.service.CommoditOrderDetailService;
import com.hnas.ecard.service.dto.DTOCommoditOrder;
import com.hnas.ecard.service.dto.DTOCommoditOrderDetail;

@Component("commoditOrderDetailService")
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
public class CommoditOrderDetailServiceImpl implements CommoditOrderDetailService{

	@Autowired
	private CommoditOrderDetailDao commoditOrderDetailDao;
	
	@Override
	public CommoditOrderDetail findByOrderNo(String orderNo) {
		return commoditOrderDetailDao.findByOrderNo(orderNo);
	}

	@Override
	public CommoditOrderDetail saveOrUpdate(CommoditOrderDetail commoditOrderDetail) {
		return commoditOrderDetailDao.saveOrUpdate(commoditOrderDetail);
	}

	@Override
	public List<DTOCommoditOrder> findOrderListByAccId(String accId) {
		return commoditOrderDetailDao.findOrderListByAccId(accId);
	}

	@Override
	public List<DTOCommoditOrderDetail> listByOrderNo(String orderNo) {
		return commoditOrderDetailDao.listByOrderNo(orderNo);
	}

	@Override
	public boolean cancelOrder(String orderNo) {
		return commoditOrderDetailDao.cancelOrder(orderNo);
	}

}
